package com.aboverock.module.system.web;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * The Class EncryptController.
 *
 * @author Rock Wang
 */
@RestController
@RequestMapping("/sys")
public class EncryptController {

    /** 密码解码器注入. */
    @Autowired
    private StringEncryptor jasyptStringEncryptor;

    @GetMapping("/encrypt")
    public String encrypt(@RequestParam String rawData) {
        return jasyptStringEncryptor.encrypt(rawData);
    }

}
